package com.nf.health.app.activity.home.view;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.nf.health.app.R;
import com.nf.health.app.activity.home.bean.SatisfactionSurveyQuestionBean;


/**
 * Created by he_pan on 2017/4/12.
 * The only genius that is worth anything is the genius for hard work
 *
 * @author he_pan
 * @Description 3 多文本
 */

public class RichTextView extends BaseSelectView {


    protected TextView tvQuestionTitle;
    protected EditText etAdvice;

    public RichTextView(Context context, SatisfactionSurveyQuestionBean bean, int position) {
        super(context, bean, position);
        this.context = context;
        this.bean = bean;
        this.position = position;
        inflater = LayoutInflater.from(context);
        initView();
        setUpView();
    }

    protected void initView() {
        View v = inflater.from(context).inflate(R.layout.item_survey_rich_text, this);
        tvQuestionTitle = (TextView) v.findViewById(R.id.tv_question_title);
        etAdvice = (EditText) v.findViewById(R.id.et_advice);
    }

    protected void setUpView() {
        tvQuestionTitle.setText(position + 1 + ". " + bean.getTitle());
    }

    public String getPosition() {
        return bean.getQnumber();
    }

    public String getSurveyAnswer() {
        return etAdvice.getText().toString().trim();
    }

}
